<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>新 21 点</title>
</head>
<body>
  <script>
    function fn(a, b, c) {
      if (b == 0) return 1.0
      var n = 0
      var res = new Array(b + c).fill(0);
      for (var i = b; i <= a && i < b + c; i++) {
        res[i] = 1.0;
        n += res[i]
      }
      for (var i = b - 1; i >= 0; i--) {
        res[i] = n / c
        n = n - res[i + c] + res[i]
      }
      return res[0]
    }
    console.log(fn(10, 1, 10))
  </script>
</body>
</html>